/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package common;

/**
 *
 * @author Vitamin
 */
public class ReConvertor {

    private int code;
    private static ReConvertor local;

    public static ReConvertor getInstance()
    {
        if(local==null)
        {
            local=new ReConvertor();
        }
        return local;
    }

    public int college(String tp)
    {
        if(tp.equalsIgnoreCase("Computing & Technology"))
        {
            code=11;
        }
        else if(tp.equalsIgnoreCase("Economy & Management"))
        {
            code=12;
        }
        else if(tp.equalsIgnoreCase("Foreign Language"))
        {
            code=13;
        }
        else if(tp.equalsIgnoreCase("Mathematics"))
        {
            code=14;
        }
        return code;
    }

    public int staffGroup(String tp)
    {
        if(tp.equalsIgnoreCase("Educational Administration Center"))
        {
            code=11;
        }
        else if(tp.equalsIgnoreCase("Library"))
        {
            code=12;
        }
        else if(tp.equalsIgnoreCase("Department of Finanical Affairs"))
        {
            code=13;
        }

        return code;
    }

    public int studentGroup(String tp)
    {
        if(tp.equalsIgnoreCase("Bachelor"))
        {
            code=11;
        }
        else if(tp.equalsIgnoreCase("Doctor"))
        {
            code=12;
        }
        else if(tp.equalsIgnoreCase("Master"))
        {
            code=13;
        }

        return code;
    }

    public int teacherGroup(String tp)
    {
        if(tp.equalsIgnoreCase("Assistant"))
        {
            code=11;
        }
        else if(tp.equalsIgnoreCase("Associate Professor"))
        {
            code=12;
        }
        else if(tp.equalsIgnoreCase("Lecturer"))
        {
            code=13;
        }
        else if(tp.equalsIgnoreCase("Professor"))
        {
            code=14;
        }
        return code;
    }

    public int rollGroup(String tp)
    {
        if(tp.equalsIgnoreCase("Staff"))
        {
            code=11;
        }
        else if(tp.equalsIgnoreCase("Student"))
        {
            code=12;
        }
        else if(tp.equalsIgnoreCase("Teacher"))
        {
            code=13;
        }

        return code;
    }


}
